package com.liang.system;

public class SystemDemo {
    public static void main(String[] args) {
        //system中的静态方法,强行停止java虚拟机的运行exit()穿入参数0表示正常结束
//        System.out.println("123");
//        System.exit(0);

        //打印时间秒数
       /* long start = System.currentTimeMillis();

        for (int i = 0; i < 10000; i++) {
            System.out.println(i);
        }

        long end = System.currentTimeMillis();

        long time = end - start;
        System.out.println(time);*/

        //复制数组
        int[] arr1 = {1, 2, 3, 4, 5};
        int[] arr2 = new int[10];
        System.arraycopy(arr1,0,arr2,0,arr1.length);
        for (int i = 0; i < arr2.length; i++) {
            System.out.println(arr2[i]);
        }
        System.arraycopy(arr1,3,arr2,8,2);
        for (int i = 0; i < arr2.length; i++) {
            System.out.println(arr2[i]);
        }
    }
}
